package cn.wolfcode.luowowo.community.domain;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter@Getter
@Document("community_answer")
public class CommunityAnswer implements Serializable {
    public static final int TYPE_ANSWER = 0; //问题的回答
    public static final int TYPE_REPLY = 1; //回答的评论
    public static final int TYPE_REPLY_IN_REPLY = 2; //评论的评论

    @Id
    private String id;

    private Long questionId; // 问题id
    private Long destId; // 地区id
    private String destName; // 地区名


    private Long userId; // 用户id
    private String username; // 用户名
    private int level; // 用户等级
    private String city;
    private String headImgUrl; // 用户头像

    private int type = TYPE_ANSWER; // 评论类别

    private String content; // 评论内容
    private Date releaseTime; // 发布时间
    private int thumbnum; // 顶的数量

    private int replynum; // 回复数量
    private int viewnum; // 浏览数量


    // 这里有回复的评论, 后期加
    List<CommunityAnswer> communityAnswers = new ArrayList<>();

    private CommunityAnswer refAnswer;  //关联的评论

}
